const constant = require('../constant')

const mongodb = {
  user: "",
  password: "",
  host: "127.0.0.1",
  port: 27017,
  database: "blog"
}

const jwt = {
  secret: "secret886886",
  unless: [
    // /^\/api\/users\/login/
    "/",
    `/api/${constant.API_VERSION}/example`,
    `/api/${constant.API_VERSION}/upload/image`,
    `/api/${constant.API_VERSION}/token/login`,
    `/api/${constant.API_VERSION}/user/register`,
    new RegExp("/api/" + constant.API_VERSION + "/user/.*/profile"),
    new RegExp("/api/" + constant.API_VERSION + "/article/doc/*"),
    new RegExp("/api/" + constant.API_VERSION + "/article/publish*"),
    new RegExp("/api/" + constant.API_VERSION + "/article/latest*"),
    new RegExp("/api/" + constant.API_VERSION + "/article/hot*"),
    new RegExp("/api/" + constant.API_VERSION + "/tag/page/*"),
    new RegExp("/api/" + constant.API_VERSION + "/tag/search/*"),
  ]
}

module.exports = {
  mongodb,
  jwt
}